<template>
    <div class="im-fq-topTable">
        <el-table   ref="receiveTable" size="mini" :data="resData"  style="width: 100%"  height="550" >
            <el-table-column type="index" sortable label="序号" width="50" :show-overflow-tooltip="true"> </el-table-column>
            <el-table-column prop="workbinCode" sortable label="缓存箱编号"  :show-overflow-tooltip="true"> </el-table-column>
            <el-table-column prop="mProductNumber" sortable label="成品型号" :show-overflow-tooltip="true"> </el-table-column>
            <el-table-column prop="barcode" sortable label="条码" :show-overflow-tooltip="true" > </el-table-column>
            <el-table-column prop="itemCode" sortable label="图号" :show-overflow-tooltip="true"> </el-table-column>
            <el-table-column prop="qualityCode" sortable label="质量编号/件号" :show-overflow-tooltip="true"> </el-table-column>
            <el-table-column prop="itemQty" sortable label="数量" :show-overflow-tooltip="true"> </el-table-column>
            <el-table-column prop="startLotNo" sortable label="起始架次" :show-overflow-tooltip="true"> </el-table-column>
            <el-table-column prop="mesCheckQualiticationId" sortable label="合格证" :show-overflow-tooltip="true"> </el-table-column>
            <el-table-column prop="creationDate" sortable label="入库时间" :show-overflow-tooltip="true"> </el-table-column>
        </el-table>
        <!-- 分页 -->
        <el-pagination  @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="pageNumber" :page-sizes="[10,20,50,100]"
            :page-size="pageSize" layout="total, sizes, prev, pager, next, jumper" :total="totalCount">
        </el-pagination>
    </div>
</template>
<script>
export default {
    name:"ImFqTopTable",
    data(){
        return{
             // 当前页数
            pageNumber: 1,
            // 数据总个数
            totalCount: 0,
            // 返回的数据数组
            resData: [],
            // 每页数据个数
            pageSize: 20,
        }
    },
    methods:{
        // 每页个数改变
        handleSizeChange(val){
            this.pageSize = val
            this.$bus.$emit('imFqPageSize',this.pageSize)
        },
        // 页数改变
        handleCurrentChange(val) {
            this.pageNumber = val;
            this.$bus.$emit('imFqPageNumber',this.pageNumber)
        },
    },
    mounted() {
        // 接收TopInput查询到的数据
        this.$bus.$on('ImFqSearchData',(e)=>{
            this.resData = e.result
            this.totalCount = e.pageParameter.totalCount
        })
  }
}
</script>
<style scoped>
.im-fq-topTable {
    text-align: center;
}
</style>